package com.thinkgem.jeesite.modules.book.dao;

import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.book.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 审批DAO接口
 *
 * @author thinkgem
 * @version 2014-05-16
 */
@MyBatisDao
public interface BookStoreDao extends CrudDao<BkBookstore>{
    String getMaxBarCode();

    String getMinBarCode();

    List<BkBookstore> getStoresByBkId(String bkId);

    BkBookstore getStoreByBkId(String bkId);

    void reduceStoreByIsbn(@Param("bkId") String bkId, @Param("mxArrived") int mxArrived);

    void addStoreByBkId(@Param("bkId") String bkId, @Param("mxArrived") int mxArrived);

    List<BkBookstore> findPrintDetails(String batchId);

    void insertBookStores(@Param("bookstores") List<BkBookstore> bookstores);

    void deleteStoreByBatchId(String batchId);

    BkBookstore findBookStoreByBanid(@Param("banid") String banid, @Param("store") String store);

    int deleteByBkId(String bkId);

    String getMaxPlaceCode(@Param("classcode") String classcode);

    List<BkBookstore> findStoresByClasscode(@Param("classcode")String classcode, @Param("place")String place);

    List<BkBookstore> getCheckList(@Param("bkId") String bkId, @Param("batch") String batch, @Param("pbdId") String pbdId);

    int deleteById(BkBookstore bkBookstore);

    List<String> checkRepeatBanId(@Param("banIds") String banIds);

    List<BkBookstore> searchBookstores(@Param("batchNum") String batchNum, @Param("snBegin") String snBegin, @Param("snEnd") String snEnd);

    List<ExportBookstore> findExportList(BkBookstore bkBookstore);

    List<String> getMaxPlaceCodeByBookId(@Param("idStr") String idStr);

    String getFirstClasscodeByBookId(@Param("idStr") String idStr);

    Map<String,String> getPurchaseLedgerAmount(@Param("begin") String begin, @Param("end") String end, @Param("batchId") String batchId);
    List<BkBookstore> getPurchaseLedger(@Param("begin") String begin, @Param("end") String end, @Param("batchId") String batchId,@Param("number") int number);

    List<BkBookstore> searchBookstoresByIds(@Param("storeIds") String storeIds);

    List<GeneralLedger> getGeneralLedger(@Param("begin") String begin, @Param("end") String end, @Param("batchNumber") String batchNumber);

    String getClasscodeByBkIdsStr(@Param("bkIds") String bkIds);

    int checkRepeatBanIdById(@Param("storeId") String storeId, @Param("banId") String banId);

    BkBookstore getById(@Param("id") String id);

    int updateStore(BkBookstore bkBookstore);

    String getMinPrintBarCode(@Param("loginName") String loginName);

    int updateByBkId(BkBookinfo bookinfo);

    List<BkBookBan> getBookBanList();

    String getMaxBarCodeByUser(@Param("loginName") String loginName);

    String myLastBanId(@Param("loginName") String loginName);

    void updateBookBanid(@Param("maxBanid") String maxBanid, @Param("loginName") String loginName);

    void changePlace(@Param("id") String id, @Param("classcode") String classcode, @Param("place") String place);

    void deleteStoreByStoreIds(@Param("storeIds") String storeIds);

    void borrow(@Param("banid") String banid);
    void back(@Param("zlId") String zlId);

    int setBookShelfByBanid(@Param("shelfId") String shelfId, @Param("banId") String banId);

    int setBookShelfByIsbn(@Param("shelfId") String shelfId, @Param("id") String id);
}
